from multiprocessing import Pool, Process
from time import sleep

# class TaskData:
#   def __init__(self, num):
#     self.num = num
#     self.res = None

def hello(i):
  sleep(1)
  return i*i

if __name__ == '__main__':
  pool = Pool(5)
  result = pool.map_async(hello, list(range(10)))
  print(result.get())